import pandas as pd
import statsmodels.api as sm
from statsmodels.formula.api import ols

df = pd.read_excel("B Chapter 08\\B_08_7.xlsx")

print(df)

formula = "value ~ C(group) + C(house)"

model = ols(formula, data=df).fit()

table = sm.stats.anova_lm(model, typ=2)

print(table)